<template>
    <div>
        <button v-on:click="fn">按钮</button>
        <button @click="fn">按钮2</button>
        <button @click="Money(4.5)">结婚花费</button>
        <button @click="Money(300000)">买车花费</button>
        <button @click="Money(800000)">买房花费</button>
        <div @click="divClick"> 
            <button @click="ButtonClick(100,$event)">内层按钮点击</button>
        </div>
    </div>
</template>
<script>

export default{
    name:'on-text',
    methods:{
        fn(){
            console.log('点击触发事件');
        },
        Money(money){
            console.log(`花费了${money}元`);
        },
        divClick(){
            console.log('点击了div');
        },
        ButtonClick(num,e){
            e.stopPropagation();
            // console.log(num);
            console.log('点击了内层按钮');
        }
    }
}
</script>